const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_construction_licence_master', {
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "唯一标识"
    },
    conpermitInfoId: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "原信息ID",
      field: 'conpermit_info_id'
    },
    projectCode: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目编码",
      field: 'project_code'
    },
    prjpwemitsNum: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "许可证编号",
      field: 'prjpwemits_num'
    },
    organDate: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "发证日期",
      field: 'organ_date'
    },
    applyConstrNum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "报建证编号",
      field: 'apply_constr_num'
    },
    sgtsNo: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "施工图审查合格书编号",
      field: 'sgts_no'
    },
    area: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "面积"
    },
    superArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "监理面积",
      field: 'super_area'
    },
    abovePlanningArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "地上规划面积",
      field: 'above_planning_area'
    },
    underPlanningArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "地下规划面积",
      field: 'under_planning_area'
    },
    upperCensorArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "图审地上面积",
      field: 'upper_censor_area'
    },
    underCensorArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "图审地下面积",
      field: 'under_censor_area'
    },
    safeArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "安全监督登记证面积",
      field: 'safe_area'
    },
    fireDesignArea: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "消防设计审核意见面积",
      field: 'fire_design_area'
    },
    prjSize: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "建设规模",
      field: 'prj_size'
    },
    singleNums: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "包含单体个数",
      field: 'single_nums'
    },
    planBDate: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "计划开工时间",
      field: 'plan_b_date'
    },
    planEDate: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "计划竣工时间",
      field: 'plan_e_date'
    },
    createDate: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "记录登记时间",
      field: 'create_date'
    },
    supportexpComments: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "配套费处理说明",
      field: 'supportexp_comments'
    },
    buildType: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "建设类别（新建、改建、扩建、二次装修）",
      field: 'build_type'
    },
    projectStatus: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目目前进度",
      field: 'project_status'
    },
    xiangMuSuoShuQuHua: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "所属区划",
      field: 'xiang_mu_suo_shu_qu_hua'
    },
    region: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "所在区县"
    },
    streetOffice: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "所属街道办事处",
      field: 'street_office'
    },
    printTime: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "打印时间",
      field: 'print_time'
    },
    touzileixing: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "投资类型"
    },
    fundingSources: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "资金来源",
      field: 'funding_sources'
    },
    fundsProof: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "资金证明",
      field: 'funds_proof'
    },
    contractMoney: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "合同金额",
      field: 'contract_money'
    },
    estimatedCost: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "工程造价（万元）",
      field: 'estimated_cost'
    },
    winBiddingNum: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "中标通知书编号",
      field: 'win_bidding_num'
    },
    tenderContract: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "中标标段",
      field: 'tender_contract'
    },
    tenderTimeLimit: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "中标工期",
      field: 'tender_time_limit'
    },
    tenderMoney: {
      type: DataTypes.DECIMAL(16,2),
      allowNull: true,
      comment: "中标价格",
      field: 'tender_money'
    },
    createPersonName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "创建人姓名",
      field: 'create_person_name'
    },
    founderId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "创建人id",
      field: 'founder_id'
    },
    status: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "状态"
    },
    remark: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "备注"
    },
    bgSgxkZsBianhao: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "变更前是想编号",
      field: 'bg_sgxk_zs_bianhao'
    },
    ststus: {
      type: DataTypes.STRING(8),
      allowNull: true,
      comment: "标识"
    },
    econCorpId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "勘察单位ID",
      field: 'econ_corp_id'
    },
    superCorpId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "监理单位id",
      field: 'super_corp_id'
    },
    designCorpId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "设计单位id",
      field: 'design_corp_id'
    },
    buildCorpId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "建设单位id",
      field: 'build_corp_id'
    },
    consCorpId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "施工单位id",
      field: 'cons_corp_id'
    },
    prjName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "项目名称",
      field: 'prj_name'
    },
    constructionSite: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "项目地点",
      field: 'construction_site'
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "是否删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    },
    createUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'create_user'
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "创建时间",
      field: 'create_time'
    },
    updateUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'update_user'
    },
    updateTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'update_time'
    }
  }, {
    sequelize,
    tableName: 'base_construction_licence_master',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
